/* 这个文件来放置主界面中的样式 */

.client-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main {
    width: 1000px;
    height: 740px;
    background-color: rgb(238, 238, 238);
    border-radius: 5px;

    display: flex;

    z-index: 2;
}

.main .left {
    width: 280px;
    height: 100%;
    background-color: rgb(46, 50, 56);

    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.main .right {
    width: 720px;
    height: 100%;

    padding: 0 20px;
}

.cover {
    width: 100%;
    height: 100%;

    background-image: url(../img/cat.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;

    /* 为了让 .cover 和 .main 能够重叠, 给 .cover 加上个定位属性  脱离指定的div 脱离默认的从上到下的 这样的排列方式*/
    position: absolute;
    top: 0;
    left: 0;

    /* 设置了下 z 轴坐标 */
    z-index: 1;

    /* 使用 css 滤镜效果, 让背景图变的朦胧起来 */
    filter: blur(20px);
}

.main .left .user {
    height: 80px;
    font-size: 20px;
    line-height: 80px;
    color: white;
    padding: 0 20px;
}

.main .left .search {
    height: 40px;
    padding: 0 20px;

    /* 使用弹性布局, 让里面的元素, 水平方向排列 */
    display: flex;
    justify-content: center;
    align-items: center;
}


.main .left .search input {
    height: 34px;
    width: 200px;
    line-height: 34px;
    font-size: 14px;
    color: white;
    background-color: rgb(38, 41, 46);

    /* 去除边框和轮廓线 */
    border: none;
    outline: none;
    /* 输入框里的文字和左侧边界有个边距 */
    padding-left: 10px;

    border-radius: 5px;
}

.main .left .search button {
    height: 34px;
    width: 34px;
    border: none;
    outline: none;

    background-color: rgb(38, 41, 46);

    border-radius: 5px;
    background-image: url(../img/搜索.png);
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: center center;
}

.main .left .search button:active {
    background-color: grey;
}

.main .left .tab {
    height: 50px;
    display: flex;
    align-items: center;
}

.main .left .tab .tab-session {
    height: 100%;
    width: 50%;

    background-image: url(../img/对话.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}


.main .left .tab .tab-friend {
    height: 100%;
    width: 50%;

    background-image: url(../img/用户2.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}

.main .left .list {
    height: 570px;

    /* 如果里面的内容太多了, 就自动提供一个滚动条 */
    overflow: auto;
}

.main .left .list li {
    height: 60px;
    padding: 10px 20px;
    color: white;
    border-top: 1px solid black;
}

.main .left .list .selected {
    background-color: rgb(46, 54, 65);
}

/* 这个样式是给会话列表使用的 */
.main .left .list li h3,
.main .left .list li p {
    height: 20px;
    font-size: 14px;
    line-height: 20px;
}

/* 这个样式是给好友列表使用的 */
.main .left .list li h4 {
    height: 40px;
    line-height: 40px;
    font-size: 20px;
    margin-bottom: 2px;
}

/* 应用了这个 css 类的元素就会被自动隐藏 */
.hide {
    display: none;
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

.main .right .title {
    height: 50px;
    line-height: 50px;
    font-size: 20px;
    text-align: center;
    border-bottom: 1px solid #ccc;
}

.main .right .message-show {
    height: 550px;

    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;

    /* 内容太多, 自动进行滚动 */
    overflow: auto;
}
/* 消息区域的CSS 样式，感觉没什么需要 介绍的*/
.main .right .message-show .message {
    margin-top: 10px;
    /* 宽度默认 100%, 高度的话不显式设定, 后续一条消息的内容有多有少 */
    display: flex;
}

/* 这个样式让子元素靠左 */
.main .right .message-show .message-left {
    justify-content: flex-start;
}

/* 这个样式让子元素靠右 */
.main .right .message-show .message-right {
    justify-content: flex-end;
}

.main .right .message-show .message .box {
    /* box 凸显出左右这样的效果, 宽度不能是 100% */
    /* width: 500px; */
    width: auto;
}

.main .right .message-show .message .box h4 {
    /* 去掉加粗效果 */
    font-weight: normal;
    height: 20px;
    line-height: 20px;
    font-size: 16px;
}

.main .right .message-show .message .box p {
    /* padding: 20px; */
    padding: 10px 20px;
    border-radius: 10px;
}

/* 给左侧右侧消息设置背景色 */
.main .right .message-show .message-left .box p {
    background-color: #fff;
}

.main .right .message-show .message-right .box p {
    background-color: rgb(123, 181, 107);
}

.main .right .message-input {
    /* 先把 textarea 转成块级元素, 方便设置尺寸啥的 */
    display: block;
    width: 100%;
    height: 100px;
    border: none;
    outline: none;

    margin-top: 2px;
    background-color: rgb(238, 238, 238);
    padding: 10px;
    resize: none;
}

.main .right .ctrl {
    height: 35px;
    display: flex;
    justify-content: flex-end;
}

.main .right .ctrl button {
    height: 35px;
    width: 100px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.main .right .ctrl button:active {
    background-color: grey;
    color: white;
}
.main .left {
    display: flex;
    flex-direction: column;
}

.group-chat {
    flex-shrink: 0; /* 不允许被压缩 */
}

.tab {
    flex-shrink: 0;
}

#session-list,
#friend-list {
    flex: 1;
    overflow-y: auto;
}

/*-------------------------------------------------------------------------------------------------*/


/* 群聊样式 */
/* Styling for the group chat section */
.group-chat {
    padding: 20px;
    background-color: #2b3138; /* Dark background for the section */
    border-radius: 8px;
    margin-top: 20px; /* Add spacing from other elements */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
        max-height: 268px; /* 控制群聊区域高度，适配 3 项 */
        overflow-y: auto;

}

.group-chat button {
    padding: 12px 25px;
    background-color: #007bff; /* Blue background */
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;

}

.group-chat button:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: scale(1.05); /* Slightly enlarge on hover for a subtle effect */
}

.group-chat button:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.8); /* Highlight the button when focused */
}

/* Group chat list styling */
#group-chat-list {
    margin-top: 20px;
    list-style-type: none;
    padding: 0;

    max-height: 240px; /* 每个项大约 70-80px，高度为3个群聊项左右 */
    overflow-y: auto;  /* 超出显示滚动条 */
}


#group-chat-list li {
    padding: 12px 20px;
    background-color: #3a434a;
    color: white;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#group-chat-list li:hover {
    background-color: #555d63; /* Lighter gray on hover */
}

#group-chat-list li h4 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

#group-chat-list li p {
    font-size: 14px;
    margin-top: 5px;
    color: #b0b0b0;
}
/*----------------------------------------------------------------------------------*/
/*删除群聊得样式*/
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-header h4 {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.group-header .join-tip {
    font-size: 14px;
    color: #666;
    margin: 0 10px;
    white-space: nowrap;
}

.group-header .delete-group {
    cursor: pointer;
    color: red;
    font-size: 16px;
}
/*--------------------------------------------------------------------------------*/

/*好友请求样式*/
.friend-requests {
    margin: 10px 0;
    padding: 10px;
    background-color: rgb(46, 50, 56); /* 统一左侧背景色 */
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    color: white;
}

.friend-requests ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.friend-requests li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    padding: 8px 12px;
    background-color: rgb(38, 41, 46); /* 和输入框按钮一致 */
    border-radius: 5px;
    border: 1px solid rgb(60, 65, 70); /* 统一线条颜色 */
}

.friend-requests button {
    margin-left: 5px;
    padding: 4px 10px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.friend-requests .accept-btn {
    background-color: #4CAF50;
    color: white;
}

.friend-requests .accept-btn:hover {
    background-color: #45a049;
}

.friend-requests .reject-btn {
    background-color: #f44336;
    color: white;
}

.friend-requests .reject-btn:hover {
    background-color: #d32f2f;
}

/* 滚动条优化 */
.friend-requests::-webkit-scrollbar {
    width: 6px;
}

.friend-requests::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* 好友列表项整体横向对齐 */
#friend-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: white;
    border-top: 1px solid black;
    height: auto;
}

/* 好友名样式 */
#friend-list li h4 {
    margin: 0;
    font-size: 18px;
    line-height: 40px;
}

/* 删除按钮样式 */
#friend-list li button {
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 14px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#friend-list li button:hover {
    background-color: #d32f2f;
}

/*--------------------------------------------------------------------------------*/
/* 头像*/

/*.message {*/
/*    display: flex;*/
/*    align-items: flex-start;*/
/*    margin: 10px;*/
/*    max-width: 80%;*/
/*}*/

/*.message-left {*/
/*    justify-content: flex-start;*/
/*}*/

/*.message-right {*/
/*    justify-content: flex-end;*/
/*    margin-left: auto;*/
/*}*/

/*.avatar-container {*/
/*    width: 40px;*/
/*    height: 40px;*/
/*    flex-shrink: 0;*/
/*    margin-right: 10px;*/
/*}*/

/*.message-right .avatar-container {*/
/*    margin-right: 0;*/
/*    margin-left: 10px;*/
/*}*/

/*.avatar {*/
/*    width: 40px;*/
/*    height: 40px;*/
/*    border-radius: 50%;*/
/*}*/

/*.box {*/
/*    background-color: #f1f1f1;*/
/*    padding: 10px 15px;*/
/*    border-radius: 10px;*/
/*    max-width: 100%;*/
/*    word-break: break-word;*/
/*}*/

/*.message-left .box p {*/
/*    background-color: #ffffff;*/
/*}*/

/*.message-right .box p {*/
/*    background-color: rgb(123, 181, 107);*/
/*    color: white;*/
/*}*/



